<?php
namespace App\Http\Common;
/**
 * Created by PhpStorm.
 * 存储所有的sql语句 ，查询语句
 * User: Administrator
 * Date: 2019-08-12
 * Time: 15:48
 */
/**
 * 项目ID
 */
class Sql{
    /**
     * @var string 查询 某个 用户
     */
    static $findUser = "select * from bf_users where id = ?";
    /**
     * @var string 查询 某个 组 所属 的 组 brother是兄弟元素 children是子元素 level是等级
     */
    static $findAllGroup = "SELECT * FROM(
SELECT @ids as brother, 
( SELECT @ids := GROUP_CONCAT(id) FROM bf_groups WHERE FIND_IN_SET(parent_id, @ids) ) as children, @l := @l+1 as level FROM bf_groups, 
(SELECT @ids :=1, @l := 0 ) b WHERE @ids IS NOT NULL ) id, bf_groups DATA 
WHERE FIND_IN_SET(DATA.id, ID.brother) ORDER BY id";
    /**
     * @var string 查询 所有菜单
     */
    static $findMenus = "SELECT * FROM bf_menus";
    /**
     * @var string 保存菜单按钮的常量
     */
    static $insertMenus = "insert into bf_menus (parent_id,name,description) values (?,?,?)";




}